<?php
class hello extends CWidget
{
	public function init()
	{
		parent::init();
	}
	public function run()
	{
		$params = Widgets::model()->findByAttributes(array('widget_name'=>'hello'));
		$p_extract = unserialize($params->params);
		$this->render('default');
	}
	public static function buildParams($params="")
	{
		$data = @unserialize($params);
		echo '<label>param1</label>';
		echo '<input type="text" id="hello_param1" name="hello[param1]" value="'.$data['param1'].'" />';
		echo '<input type="hidden" name="widget" value="hello" />';
	}
	public function getParams($post)
	{
		return  serialize($post['hello']);
	}
}